<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="programalist.title"/></title>
    <meta name="heading" content="<fmt:message key='programalist.heading'/>"/>    
</head>

<form:form id="programalist">

<c:set var="buttons">
    <input type="button" class="button" 
        onclick="location.href='<c:url value="/programa/programaform.html"/>'"
        value="<fmt:message key="button.add"/>"/>
        
    <input type="button" class="button" 
    	onclick="location.href='<c:url value="/mainMenu.html"/>'"
        value="<fmt:message key="button.done"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false" /><br/><br/>
<table id="programas" cellpadding="0" class="table" cellspacing="0" style="width: 600px" > 
	<thead> 
		<tr> 
            <th scope="col"><fmt:message key="label.descripcion"/></th>
            <th scope="col"><fmt:message key="label.iniciovigencia"/></th>
            <th scope="col"><fmt:message key="label.finvigencia"/></th>
            <th scope="col"><fmt:message key="programaform.imprime.mensaje"/></th>			
		</tr>
	</thead> 
	<tbody id="programasbody">
		<tr id="pattern" style="display:none;">
			<td> 
				<span id="tableDescripcion"></span>
			</td>
			<td> 
				<span id="tableInicioVigencia"></span>
			</td>
			<td> 
				<span id="tableFinVigencia"></span>						
			</td>
			<td> 
				<span id="tableImprimeMensaje"></span>						
			</td>									
		</tr> 	
		<c:forEach var="programa" items="${programas}" varStatus="status">	
			<c:choose>
				  <c:when test="${status.index % 2 == 0}"><tr class="odd" ></c:when>
				  <c:otherwise><tr class="even" ></c:otherwise>
			</c:choose>
            	<td>
					<a href="<c:url value="/programa/programaform.html?id=${programa.id}"/>">					
						${programa.dePrograma}
					</a>            	
				</td>
				<td>
					${programa.desFechaInicioVigencia}
				</td>
				<td>
					${programa.desFechaFinVigencia}
				</td>
                <td>
                	<c:choose>
                		<c:when test="${programa.stImprimeMensaje eq true}">
                			<fmt:message key='common.yes'/>
                		</c:when>
                		<c:otherwise>
                			<fmt:message key='common.no'/>
                		</c:otherwise>
                	</c:choose>
                </td>
           </tr>
        </c:forEach>				
	</tbody>
</table> 

<input type="hidden" id="programa_date_format" value="${programa_date_format}"/>
<c:out value="${buttons}" escapeXml="false" />
</form:form>